Component({
  properties: {
    oneLine: {
      type:Boolean,
      value:true
    },
    show: {
      type:Boolean,
      value:false
    },
    title: {
      type:String,
      value:'标题'
    },
    placeholder: {
      type:String,
      value:'输入的信息'
    },
    value: {
      type:String,
      value:''
    }
  },
  data: {
    dataShow:false,
    dataValue:'',
    beforeClose:{},

  },
  lifetimes: {
    attached: function () {
      this.setData({
        beforeClose:(action=> this.beforeClose(action)),
        dataValue:this.properties.value
      });
    }
  },
  methods: {
    beforeClose(action) {
      //console.log('beforeHide:',action);
      //console.log('dataValue:',this.data.dataValue);
      this.triggerEvent('before-close',{
        action: action,
        value: this.data.dataValue
      });
      return false;
    },
    bindInput(e) {
      this.setData({dataValue:e.detail.value});
    }
  }
})
